home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / C++ AppleLink Messages / CPlus.Dev$ 3⁄16⁄90 / 0075-¿TExtendedText from -Mar90 < prev    next >
Encoding:
Text File  |  1990-03-16  |  1.6 KB  |  52 lines  |  [TEXT/GEOL]

  1. Item    9757426                         14-March-90        06:24PST
  2.  
  3. From:   V0683                           Amoco Tech, Eric Berdahl,VAR
  4.  
  5. To:     MACAPP.TECH$                    MacApp Technical
  6.         CPLUS.DEV$                      C++ Interest List--Developers
  7.         CPLUS.APPLE$                    C++ Interest List--Apple Employees
  8.  
  9. Sub:    ¿TExtendedText from C++?
  10.  
  11. Gentlepersons,
  12.  
  13. I am trying to use the TExtendedText object (on the MacApp Goodies Vol 2 disk)
  14. from my C++ MacApp program.  It works very well, doing exactly what I want
  15. (kudos to whoever developed the sucker!) with one glaring exception.  When I do
  16. a GetValue(), GetValue itself calculates the value properly, but somehow it
  17. gets mangled in the return to the C++ calling routine.  The value that is
  18. assigned to the C++ extended variable is 0.0.  Can anybody help me?  Relevant
  19. code sections follow:
  20.  
  21. class TExtendedText : public TEditText {
  22. public:
  23.     ...
  24.     virtual pascal extended GetValue();
  25.     ...
  26. };
  27.  
  28. pascal void
  29. TMyCommand::DoIt()
  30. {
  31.     ...
  32.     TWindow*    aWindow;
  33.     ...
  34.     extended anExtended;
  35.     ...
  36.     anExtended = ((TExtendedText*)aWindow->FindSubView('mnod'))->GetValue();
  37.     printf("GetValue returned %lf\n", anExtended);
  38.     ...
  39. }
  40.  
  41. I also put a Writeln('GetValue = ', theValue) in TExtendedText.GetValue to
  42. print the value which is being calculated.  I think the problem rests in the
  43. actual returning code to the C routine.  (Oh, it may be important to know: MPW
  44. 3.1, MacApp 2.0b9, C++ 3.1b1, on a MacIIx, System 6.0.3, code compiled -mc68020
  45. and -mc68881.)
  46.  
  47. Thanx in advance,
  48. Eric Berdahl
  49. Amoco Technology Company
  50. AppleLink: V0683
  51.  
  52.